-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command line export for Tiled #318
Conversation
This is great! I just searched google for a method to export via command line for the same reason and didn't get very far. Now i need to pull and build, and hopefully be able to add this to my build scripts also. Thanks Thanks Thanks! --edit-- terminal is flooded with:
|
@jasonmcleod Why use such an old version of Qt. Did you try with Qt 4.8.4? Or try the new Qt 5 RC. Tiled has so far not been tried with that version of Qt on OSX, but I'm curious whether it works. |
Does this export method work with large maps? I have a 1200x600 map that won't export to image. Last I knew, the export failed because of a QT issue ... maybe this doesn't have that issue? |
@Earl-Brown This is about exporting the map to one of the supported map formats, not about exporting to an image. The only issue I could think of when trying to export a 1200x600 map to an image would be memory usage. It needs to be able to allocate enough memory for the entire image, and then write that to whatever file format you have in mind. Usually you wouldn't export a map 1:1 because the main point of using a tile map is avoiding that kind of memory usage, but rather export it at a smaller scale (just zoom out first and choose "Use current zoom level" in the Save As Image dialog). Btw, since recently (in the dailies) there is a separate tool shipped with Tiled called "tmxrasterizer", which does basically the same thing as the Save As Image dialog. It has the same problem regarding image size, though. |
Bummer for me that it's not for images. :( But you're right about it being a memory issue. I don't remember what the issue really was, but I think it had to do with a max value for pointers in image manipulation. I'm debating writing an image builder on my own. If only I didn't have 50 other projects in my to-do list :) |
It'll start up (if you don't use the app bundle and invoke it directly), but crashes as soon as you try to do anything. =) |
@cbdillon Btw, sorry for not commenting specifically on your change. I think the functionality is definitely wanted but I'm not sure about the exact arguments format and I don't like to have all that code directly in the main function. Also, I've been very busy while I tried to focus on getting a Tiled 0.9 release out. I'll look closely at this change once that is done. |
+1 on this change. I need this functionality for my asset pipeline as well. |
@bjorn I'm considering refactoring this into a stand-alone utility that's built alongside Tiled. How would you feel about that change? |
@netguy204 Sounds fine to me, so go ahead! |
Was this ever merged or a commandline tool built for command line (JSON) export of maps? |
@elisee Not yet, unfortunately. |
I solved my problem another way so this should go on without me. |
Any joy with this? It'd be super handy to have build tools and other things that can watch/auto-compile .tmx files into formats such as .json. Of course I need it for OSX not Windows .exe :) |
I've given up on it - but one of these centurys, I'm going to build a web-based viewer. |
hi guys, (i'm developing some game with based maps on tiled. and this feature, like: "./tiled --export-image layers[2,3,4,5]" and similar :) it will be very helpfull for us. because we plan to have more than <= 10 maps. so, automatic batch scripting is right choice for us than manual clicking / save as image in tiled. it's very booring so...) |
+1 for more command line tools generally! |
Because of the high demand I've decided to merge this change. I think the command line format is fine, though the documentation should be fixed according to @stefanbeller's comment and the error checking should probably be a bit more strict. I will clean up the code a bit later, as time allows. I'm sorry that it has taken so long. I never planned for this, there's just continuously other things to do as well. I hope to still release a Tiled 0.11 this year and this feature should definitely be part of it. |
hi there, $ ./tiled --export-map /absolute/path/experiments/MAPY-LARGE/y/y.tmx ./y.png Error: Plugin verification data mismatch in '/home/local/tmp/smid/SMAZ/src/tiled.git/build/lib/tiled/plugins/libcsv.so' on:
and in moc_csvplugin.cpp has right version, this one: |
Usually I think this means the plugin was compiled with a different version of Qt than Tiled, but I still need to check this feature myself as well actually. I'll look at it as soon as possible (though this may take some days). Note though, that this export map feature does not cover rendering the map to an image. It can only be used to convert the map to the different file formats supported by Tiled. To render a map to an image from the command line there is a tool called |
ah! i see. ok. so i will try it with tmxrasterizer. thx. |
65e5c11 should address the problems with the CSV plugin. |
Hi! I'm a programmer over at Double Fine and we've been using Tiled to lay out levels for one of our Amnesia Fortnight prototypes. In order to integrate Tiled nicely into our build pipeline, we need the ability to transform tmx files to export formats on the command line. This change hacks some of that behavior into main.cpp. It lets us integrated Tiled into our build server.
Thought it might be of interest to you as well!